package com.wonderful.wedding.mapper;

import com.wonderful.wedding.model.Group;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface GroupMapper {

    @Select("SELECT * FROM groups WHERE name = #{name}")
    public Group findByName(@Param("name") String name);

    @Insert("INSERT INTO groups (name) VALUES(#{name})")
    int create(@Param("name") String name);
}
